import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
import Cart from '../views/Cart'
import Fiends from '../views/Fiends'
import Search from '../views/Search'
import no404 from '../views/No404'
import Main from '../views/Main'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Main,
    children: [
      {
        path: '/home',
        component: Home
      },
      {
        path: '/cart',
        component: Cart
      },
      {
        path: '/fiends',
        component: Fiends
      },
      {
        path: '/search',
        component: Search
      }
    ]
  },
  {
    path: '*',
    component: no404
  }
]

const router = new VueRouter({
  routes
})

export default router
